const Timestamp = new Date().getTime();
const TransformPages = require("uni-read-pages");
const { webpack } = new TransformPages();
const tfPages = new TransformPages()
module.exports = {
  devServer: {},
  productionSourceMap: false,
  publicPath: "./",
  parallel: false,
  lintOnSave: false,
  configureWebpack: {
    output: {
      filename: `js/[name].${Timestamp}.js`,
      chunkFilename: `js/[name].${Timestamp}.js`,
    },
    plugins: [
      new webpack.DefinePlugin({
        ROUTES: webpack.DefinePlugin.runtimeValue(() => {
          // const tfPages = new TransformPages({
          //   includes: ["path", "name", "aliasPath"],
          // });
          const tfPages = new TransformPages({
               includes:["path","name","aliasPath"]
          });
          return JSON.stringify(tfPages.routes);
        }, true),
      }),
      // new tfPages.webpack.DefinePlugin({
      //   ROUTES: JSON.stringify(tfPages.routes)
      // }),
    ],
  },
};
